//
//  AppointmentTopView.m
//  QuickCure
//
//  Created by 凉气的Mac on 16/9/13.
//  Copyright © 2016年 haoge. All rights reserved.
//

#import "AppointmentTopView.h"

@implementation AppointmentTopView



-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        //设置界面
        [self setupUI];
        
    }
    return self;
}

#pragma mark --
#pragma mark --设置界面
-(void)setupUI{
    
    //圆
    UIButton *rightBtn = [[UIButton alloc]init];
    
    [rightBtn setTitle:@"已就诊" forState:UIControlStateNormal];
    
    [rightBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    
    rightBtn.titleLabel.font = kFONT15;
    
    [rightBtn setBackgroundColor:[UIColor colorWithRed:0.087 green:0.338 blue:0.502 alpha:1.000]];
    
    rightBtn.layer.cornerRadius = 30;
    
    rightBtn.clipsToBounds = YES;
    
    [self addSubview:rightBtn];
    
    [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.width.equalTo(60);
        
        make.top.equalTo(self).offset(15);
        
        make.bottom.equalTo(self).offset(-15);
        
        make.right.equalTo(self).offset(-20);
        
    }];
    
    
    //病人头像
    UIImageView *icon = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"name"]];
    
    [self addSubview:icon];
    
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.width.equalTo(60);
        
        make.top.equalTo(self).offset(15);
        
        make.bottom.equalTo(self).offset(-15);
        
        make.left.equalTo(self).offset(20);
        
    }];
    
    //病人名字
    UILabel *nameLabel = [[UILabel alloc]init];
    
    nameLabel.text = @"可超";
    
    [self addSubview:nameLabel];
    
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(icon);
        
        make.left.equalTo(icon.mas_right).offset(15);
        
    }];
    
    //疾病名称
    UILabel *illnessLabel = [[UILabel alloc]init];

    illnessLabel.text = @"不举";
    
    illnessLabel.font = kFONT15;
    
    illnessLabel.textColor = [UIColor colorWithWhite:0.800 alpha:1.000];
    
    [self addSubview:illnessLabel];
    
    [illnessLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(nameLabel);
        
        make.left.equalTo(nameLabel.mas_right).offset(15);
        
    }];
    
    //就诊时间
    UILabel *timeLabel = [[UILabel alloc]init];
    
    timeLabel.text = @"就诊:2016/6/19";
    
    timeLabel.font = kFONT15;
    
    timeLabel.textColor = [UIColor colorWithWhite:0.800 alpha:1.000];
    
    [self addSubview:timeLabel];
    
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(nameLabel.mas_bottom).offset(10);
        
        make.left.equalTo(nameLabel);
        
    }];

   
    
    
    
    

    
}



@end


































